package generator.addons;

import java.sql.Date;
import java.util.Random;

/**
 * @author Necro
 */
public class SimpleDataGenerator {
    
    public static int getDuration(){
        Random rand = new Random();
        int[] sample = { 4, 7 , 9, 14, 18 , 21 };
        return sample[rand.nextInt(sample.length)];
    }
    
    public static float getMoneyTiny()
    {
        Random rand = new Random();
        int[] samplePref = { 30, 50 , 75, 100, 150 , 25 , 125};
        String[] currency = { "$", "zł" };
        return samplePref[rand.nextInt(samplePref.length)];
    }
    
    public static float getMoneyLow(){
        Random rand = new Random();
        int[] samplePref = { 100, 50 , 250, 300, 150 , 400 , 99 , 199 , 49 };
        String[] currency = { "$", "zł" };
        return samplePref[rand.nextInt(samplePref.length)];
    }
    
    public static float getMoneyHigh(){
        Random rand = new Random();
        int[] samplePref = { 399, 499, 400,700, 999, 1200, 1500, 2000, 2999, 1599, 1800, 1150 };
        String[] currency = { "$", "zł" };
        return samplePref[rand.nextInt(samplePref.length)];
    }
    
    public static int getPlaceLimits(){
        Random rand = new Random();
        int[] sample = { 10, 34, 68, 52, 80, 92};
        return sample[rand.nextInt(sample.length)];
    }
    
    public static int getPlaceLimitsForAttraction(){
        Random rand = new Random();
        int[] sample = { 30, 80, 100, 200, 340, 500};
        return sample[rand.nextInt(sample.length)];
    }
    
    public static Date getDate(){
        Random rand = new Random();
        Date result = new Date(108, rand.nextInt(12) , rand.nextInt(20));
        return result;
    }
    
    public static Date getDate(int minmonth, int maxmonth){
        Random rand = new Random();
        Date result = new Date(108, rand.nextInt(maxmonth - minmonth) + minmonth, rand.nextInt(20));
        return result;
    }
    
    public static String fillWithZeros(int size, int number){
        String result      = "";
        int digitsInNumber = Integer.toString(number).length();
        for(int i = 0, diff = size - digitsInNumber; i < diff; ++i)
            result += "0";
        
        return result + Integer.toString(number);
    }
     
    public static String getPhone(){
        Random rand = new Random();
        String result = "0" + fillWithZeros(2, rand.nextInt(100))
                + "00" + fillWithZeros(3, rand.nextInt(1000));  
        return result;
    } 
    
    
    public static String getNIP(){
        Random rand = new Random ();
        
        String result = fillWithZeros(3,rand.nextInt(1000)) + "-"
                + fillWithZeros(3,rand.nextInt(1000)) + "-"
                + fillWithZeros(2,rand.nextInt(100)) + "-"
                + fillWithZeros(2,rand.nextInt(100));
        
        return result;
    }
    
    public static String getName(){
        Random rand = new Random();
        
        String[] names = {
            "Adam", "Andrzej", "Antoni", "Agata", "Aneta", "Bogdan", "Bonifacy", "Czesław",
            "Cezary", "Cyprian", "Damian", "Dominik", "Dariusz", "Franciszek", "Grzegorz",
            "Horacy", "Henryk", "Ignacy", "Józef", "Krzysztof", "Kamil", "Marek", "Mateusz", "Miłosz",
            "Monika", "Marian", "Natalia", "Nikodem", "Przemysław", "Paweł", "Radosław", "Stanisław",
            "Sławomir", "Sabina", "Szymon", "Tomasz", "Teodor", "Urszula", "Wojciech", "Władysław", "Włodzimierz"
        };
        
        String result = names[rand.nextInt(names.length)]+" ";
        
        String[] surnames = {
            "Adamczyk", "Antonowicz", "Anusiak", "Bobrowicz", "Białowieski", "Badura", "Cejlowski", "Cygan",
            "Duda", "Dąbrowski", "Dwojak", "Dobrowolski", "Cesarz", "Chlebowicz", "Chmiel", "Chojnacki",
            "Hader", "Hajduk", "Hałas", "Słowacki", "Leniwy", "Tomaszewski", "Popławski", "Pyrzewski", "Suwny",
            "Słomny"                    
        };
      
        result+=surnames[rand.nextInt(surnames.length)];
        
        return result;
    }
    
   public static String getAddress(){
       Random rand = new Random();
       
       String[] cities = { "KRAKÓW", "SKAWINA", "ZATOR", "TARNÓW", "BABICE", "OŚWIĘCIM", "BIELSKO-BIAŁA", "ANDRYCHÓW" };
       String[] streets = { "Sławkowska", "Piwniczna", "Staropolska", "Nowohucka", "Traugutta", "Słowackiego",
            "Mickiewicza", "Pomorska", "Batorego", "Włodawska", "Czyżewska"};
       
       String result = cities[rand.nextInt(cities.length)] 
               + " Ul." + streets[rand.nextInt(streets.length)]
               + " " + rand.nextInt(300);
            
       return result;
   };
       
       public static String getCompanyName(){
           Random rand = new Random();
           String[] companies = {
                "Anmar", "Archimedes", "Aproba", "Bit", "Benetton",
                "Cern", "Comarch", "Careffour", "Delphi", "Donnovan",
                "Elle", "Unimat", "InterAqua", "Novotel", "Moloch",
                "Seiko", "Sharp", "IBM", "Rossman"};
  
           String result = companies[rand.nextInt(companies.length)].toUpperCase();
           
           return result;
       }
}
